package redisService

import (
	"tools_go/common/config"

	"github.com/go-redis/redis"
)

var rdb *redis.ClusterClient

func init() {
	appConfig := config.AppConfig
	rdb = redis.NewClusterClient(&redis.ClusterOptions{
		Addrs:        appConfig.Redis.ClusterHost,
		MaxRedirects: appConfig.Redis.MaxRedirects,
		Password:     appConfig.Redis.Password,
	})
	_, err := rdb.Ping().Result()
	if err != nil {
		panic(err)
	}

}
